package contracts.fraud

import org.springframework.cloud.contract.spec.Contract

Contract.make {
    request {
        method 'POST'
        url('/testPrice')
        body([
                name: "fraud"
        ])
        headers {
            contentType('application/json')
        }
    }
    response {
        status 200
        body("""
  {
    "code": "000000",
    "mesg": "处理成功"
     result: "Sorry ${fromRequest().body('\$.name')} but you're a fraud"
  }
  """)
        headers {
//            header('Content-Type': 'application/json;charset=UTF-8')
            header(contentType(), "${fromRequest().header(contentType())};charset=UTF-8")
        }
    }
}